<?php
$server ="localhost";
$username ="root";
$password ="";
$mysqli =new mysqli ($server,$username,$password);
$result=mysqli_query ($mysqli,"create database account_db");
echo"<P>创建数据库:";
var_dump ($result);
$result =mysqli_query($mysqli,"use account_db");
echo"<P>选择数据库:";
var_dump ($result);
$result =mysqli_query($mysqli,"set names utf8");
echo"<P>设置数据库编码:";
var_dump ($result);
$result =mysqli_query($mysqli,
"create table account(id int auto_increment primary key,username varchar(50) not null,password varchar(50) not null,eamil varchar(50) not null)";
echo "<p>创建表:"
var_dump($result);
$result=mysqli_query ($mysqli,"insert into account(username,password,email) values('jack','123456','liuyi@examlie.com')");
echo "<P>插入数据:"
var_dump($result);
mysqli_close($mysqli);
?>